package class01;

import java.util.Random;

public class MathTest {
    public static void main(String[] args) {
        //ceil 向上取整
        System.out.println(Math.ceil(1.1));
//        floor向下取整
        System.out.println(Math.floor(1.9));
        //round 四舍五入
        System.out.println(Math.round(1.5));

        Random r = new Random();
        System.out.println("随机整数：" + r.nextInt());
        System.out.println("随机小数：" + r.nextDouble());
        System.out.println("随机布尔值：" + r.nextBoolean());
        System.out.println("随机浮点数：" + r.nextFloat());
        System.out.println("随机长整数：" + r.nextLong());
        byte[] bytes = {1, 2, 3, 4, 5};
        r.nextBytes(bytes);

    }
}
